<?php
/**
 * Created by PhpStorm.
 * User: u
 * Date: 2018/12/19
 * Time: 21:14
 */
namespace common\sources\write\businessrechargerecord;

class BusinessRechargeRecordAccess implements IBusinessRechargeRecordAccess
{
    //
    public function addRechargeRecord($data){
        $insert = 'INSERT INTO business_recharge_record (buy_id,amount,rech_type,status,pay_type,bank_id,order_id,remark,create_time)
                   VALUES (:buy_id,:amount,:rech_type,:status,:pay_type,:bank_id,:order_id,:remark,:create_time)';
        $res = Yii::$app->db->createCommand($insert )->bindValues([
            ':buy_id' => $data['buy_id'],
            ':amount'=>$data['amount'],
            ':rech_type'=>$data['rech_type'],
            ':status'=>1,
            ':pay_type' => $data['pay_type'],
            ':bank_id' => $data['bank_id'],
            ':order_id' => $data['order_id'],
            ':remark' => $data['remark'],
            ':create_time'=>$data['create_time']
        ])->execute();
        return $res;
    }
}